<h2>Why is this an issue?</h2>
<p>Spring Data Repository supports paging for queries, allowing you to return results in small, manageable chunks rather than retrieving an entire
large result set.</p>
<p>The conventional approach to paginating data in Spring is to use the <code>Pageable</code> interface to control pagination and to store the query
results into a <code>Page</code> or <code>Slice</code>. If a query declaration in a <code>Spring Data Repository</code> returns a <code>Page</code> or
<code>Slice</code> without taking a <code>Pageable</code> as an input, it raises a runtime exception.</p>
<p>This rule raises an issue on queries in a <code>Repository</code> that return a <code>Page</code> or <code>Slice</code> without taking a
<code>Pageable</code> as an input.</p>
<h2>How to fix it</h2>
<p>Ensure that query methods returning a <code>Page</code> or <code>Slice</code> include a <code>Pageable</code> parameter in their method
signature.</p>
<h3>Code examples</h3>
<h4>Noncompliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
interface ItemRepository extends JpaRepository&lt;Item, Long&gt; {
    Page&lt;Item&gt; findItems(); //non compliant, no Pageable parameter
}
</pre>
<h4>Compliant solution</h4>
<pre data-diff-id="1" data-diff-type="compliant">
interface ItemRepository extends JpaRepository&lt;Item, Long&gt; {
    Page&lt;Item&gt; findItems(Pageable pageable);
}
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
  <li> Spring - <a href="https://docs.spring.io/spring-data/jpa/reference/jpa/query-methods.html">JPA Query Methods</a> </li>
  <li> Spring - <a
  href="https://docs.spring.io/spring-data/jpa/reference/repositories/query-methods-details.html#repositories.paging-and-sorting">Defining Query
  Methods</a> </li>
</ul>
<h3>Articles &amp; blog posts</h3>
<ul>
  <li> Spring Guides - <a href="https://reflectoring.io/spring-boot-paging/">Paging with Spring Boot</a> </li>
</ul>

